using UnityEngine;

namespace ConsentManagementProviderLib.Observer
{
	internal class BroadcastEventsExecutor : MonoBehaviour
	{
		private void Awake()
		{
			base.gameObject.name = "CMP_BroadcastEventsExecutor";
			Object.DontDestroyOnLoad(base.gameObject);
		}

		private void Update()
		{
			while (BroadcastEventDispatcher.actions.Count > 0)
			{
				BroadcastEventDispatcher.actions.Dequeue()?.Invoke();
			}
		}
	}
}
